package com.feri.cloudlike.api.service;

import com.feri.cloudlike.common.vo.R;
import com.feri.cloudlike.common.dto.LikeAddDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * projectName: Cloudlike
 * author: CGY
 * time: 2020/10/31 10:27
 * description:
 */
@Service
public class LikeServiceImpl {
    @Autowired
    private RestTemplate restTemplate;

    public R dz(LikeAddDto dto){
//        restTemplate.put();
//        restTemplate.delete();
        return restTemplate.postForObject("http://LikeProvider/provider/like/dz.do",dto,R.class);
    }
    public R all(){
        return restTemplate.getForObject("http://LikeProvider/provider/like/count.do",R.class);
    }
}
